﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Home.Master" AutoEventWireup="true"
    CodeBehind="duan.aspx.cs" Inherits="Giaiphongmatbang.duan" EnableEventValidation="false"
    MaintainScrollPositionOnPostback="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="UserControl/ucPaging.ascx" TagName="ucPaging" TagPrefix="uc1" %>
<%@ Register Src="UserControl/childNav.ascx" TagName="childNav" TagPrefix="uc2" %>
<%@ Register src="UserControl/ucGiavang.ascx" tagname="ucGiavang" tagprefix="uc3" %>
<%@ Register src="UserControl/ucVisite.ascx" tagname="ucVisite" tagprefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Style/duan.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            $("table tr:odd").addClass("odd");
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="sidebar" class="nl">
        <div id="childNav">
            <uc2:childNav ID="childNav1" runat="server" />            
        </div>
        <div style="margin-bottom:8px">            
            <uc3:ucGiavang ID="ucGiavang1" runat="server" />
        </div>
        <uc4:ucVisite ID="ucVisite1" runat="server" />                
    </div>
    <div class="mainContent nr">
 <%--       <asp:UpdatePanel ID="pnltable" runat="server">
            <ContentTemplate>--%>
                <asp:Panel ID="pnl1" runat="server">
                    <div class="table">
                        <div class="box-title clearfix">
                            Danh sách các dự án
                            <div class="nr" style="margin-top: 3px;">
                                <asp:DropDownList ID="drdChoose" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drdChoose_SelectedIndexChanged"
                                    CssClass="field">
                                    <asp:ListItem Value="0">--Lựa chọn dự án--</asp:ListItem>
                                    <asp:ListItem Value="1">-----Toàn bộ dự án----</asp:ListItem>
                                    <asp:ListItem Value="2">-----Dự án đã hoàn thành-------</asp:ListItem>
                                    <asp:ListItem Value="3">-----Dự án chưa hoàn thành-----</asp:ListItem>
                                    <asp:ListItem Value="4">-----Dự án cho phép xem--------</asp:ListItem>
                                    <asp:ListItem Value="5">-----Dự án không cho phép xem--</asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="box-content">
                            <p>
                                Tìm kiếm theo</p>
                            <p>
                                <span>+Tên dự án:</span>
                                <asp:TextBox ID="txtProjectName" runat="server" CssClass="field"></asp:TextBox>
                            </p>
                            <p>
                                <span>+Thời gian: <span style="text-align: right; width: 50px">Từ</span></span>
                                <span>
                                    <asp:TextBox ID="txtFrom" runat="server" CssClass="field" />
                                    <asp:CalendarExtender ID="txtFrom_CalendarExtender" runat="server" Enabled="True"
                                        TargetControlID="txtFrom">
                                    </asp:CalendarExtender>
                                </span>
                            </p>
                            <p>
                                <span style="text-align: right">Đến</span> <span>
                                    <asp:TextBox ID="txtTo" runat="server" CssClass="field" />
                                    <asp:CalendarExtender ID="txtTo_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtTo">
                                    </asp:CalendarExtender>
                                </span><span style="text-align: right">
                                    <asp:Button ID="btnShow" runat="server" Text="Hiển thị" CssClass="button" OnClick="btnShow_Click" />
                                </span>
                            </p>
                        </div>
                        <div style="text-align: center; width: 100%">
                            <asp:Literal ID="ltrMessage" runat="server" EnableViewState="false"></asp:Literal>
                        </div>
                        <asp:GridView ID="grvProject" runat="server" AutoGenerateColumns="false" Width="100%"
                            BorderWidth="0" GridLines="None" OnRowDataBound="grvProject_RowDataBound" OnRowCommand="grvProject_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="TT" ItemStyle-Width="45px">
                                    <ItemTemplate>
                                        <%# (Container.DataItemIndex + 1) + (ucPaging1.CurrentPage-1) * ucPaging1.PageSize  %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Dự án" ItemStyle-Width="250px">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbt" runat="server" CommandArgument='<%#Eval("ProjectID") %>' CommandName="btnView"
                                            ToolTip="Xem chi tiết dự án" CssClass="view"><%#Eval("ProjectName") %></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="Investor" HeaderText="Chủ đầu tư" />
                                <asp:BoundField DataField="CreatedDate" HeaderText="Ngày bắt đầu" DataFormatString="{0:d}"
                                    ItemStyle-Width="100px" />
                                <asp:TemplateField HeaderText="Chức năng" ItemStyle-Width="65px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/Images/view_text.png" CommandArgument='<%#Eval("ProjectID") %>'
                                            CommandName="btnEdit" ToolTip="Xem thông tin dự án" />
                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/delete.png" CommandArgument='<%#Eval("ProjectID") %>'
                                            CommandName="btnDelete" OnClientClick="return confirm('Xác nhận hành động xóa?');" ToolTip="Xóa"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <uc1:ucPaging ID="ucPaging1" runat="server" />
                    </div>
                    <!--End .table-->
                </asp:Panel>
                <!--End .table-->
                <asp:Panel ID="pnl2" runat="server" Visible="false">
                    <div class="table">
                        <div class="box-content">
                            <p>
                                <span>Tên dự án:</span>
                                <asp:Literal ID="ltrProjectName" runat="server" /></p>
                            <p>
                                <span>Ban quản lý dự án: </span>
                                <asp:Literal ID="ltrProjectInvestor" runat="server" /></p>
                        </div>
                        <div id="seach" class="box-content">
                            <p>
                                Tìm kiếm theo
                            </p>
                            <p>
                                <span>+Tên chủ hộ:</span>
                                <asp:TextBox ID="txtHouseHold" runat="server" CssClass="field" />
                                <asp:Button ID="btnSearch" runat="server" Text="Hiện thị" CssClass="button" 
                                    onclick="btnSearch_Click" /><span style="width:45px">&nbsp;</span>
                                <asp:Button ID="btnExport" runat="server" CssClass="button" Text="Xuất báo cáo" 
                                    onclick="btnExport_Click" />                             
                                <asp:Button ID="btnDetailExport" runat="server" CssClass="button" Text="Xuất báo cáo chi tiết"
                                    onclick="btnDetailExport_Click" />
                            </p>
                        </div>
                        <div class="box-title">
                            Danh sách các đối tượng bị tác động
                            <div class="nr" style="margin-top: 3px">
                                <asp:ImageButton ID="btnInsert" runat="server" ImageUrl="~/Images/add-button.jpg"
                                    ToolTip="Thêm mới đối tượng" OnClick="btnInsert_Click" />
                            </div>
                        </div>
                        <asp:GridView ID="grvHouseHold" runat="server" AutoGenerateColumns="false" Width="100%"
                            BorderWidth="0" GridLines="None" OnRowDataBound="grvHouseHold_RowDataBound" OnRowCommand="grvHouseHold_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="TT" ItemStyle-Width="45px">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Chủ hộ" ItemStyle-Width="250px">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="lbtHouseHold" runat="server" OnClick="lbtView_Click" CommandArgument='<%#Eval("CMND") %>'
                                            ToolTip="Xem chi tiết chủ hộ" CssClass="view"><%#Eval("FullName") %></asp:LinkButton>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField HeaderText="Số nhân khẩu" DataField="MemberCount" />
                                <asp:BoundField HeaderText="Địa chỉ" DataField="Address" ItemStyle-Width="250px" />
                                <asp:TemplateField HeaderText="Chức năng">
                                    <ItemTemplate>
                                        <asp:ImageButton runat="server" ImageUrl="~/Images/pen.png" CommandArgument='<%#Eval("HouseHoldID") %>'
                                            CommandName="btnEdit" ToolTip="Sửa" />
                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:ImageButton runat="server" ImageUrl="~/Images/delete.png" CommandArgument='<%#Eval("HouseHoldID") %>'
                                            CommandName="btnDelete" ToolTip="Xóa" OnClientClick="return confirm('Bạn có chắc chắn xóa!');" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                        <div style="text-align: center; width: 100%">
                            <asp:Literal ID="Literal1" runat="server" EnableViewState="false"></asp:Literal>
                        </div>
                        <uc1:ucPaging ID="ucPaging2" runat="server" />
                        <div class="box-content" style="text-align: center">
                            <asp:Button ID="btnReturn1" CssClass="button" runat="server" Text="Trở về" OnClick="btnReturn1_Click" />
                        </div>
                    </div>
                    <!--End table-->
                </asp:Panel>
                <!-- End pnl2-->
                <asp:Panel ID="pnl3" runat="server" Visible="false">
                    <div class="box-title">
                        Chi tiết chủ hộ                        
                    </div>
                    <fieldset class="box-content">
                        <legend><strong>Thông tin chủ hộ</strong></legend>
                        <p>
                            <span>Tên chủ hộ:</span><asp:Literal ID="ltrFullName" runat="server" /></p>
                        <p>
                            <span>Địa chỉ:</span><asp:Literal ID="ltrAddress" runat="server" /></p>
                        <p>
                            <span>Giới tính:</span><asp:Literal ID="ltrGender" runat="server" /></p>
                        <p>
                            <span>Số nhân khẩu:</span><asp:Literal ID="ltrMemberCount" runat="server" /></p>
                        <div>
                            <div class="nl">
                                <p>
                                    Danh sách các tài sản thiệt hại phải đền bù:                            
                                </p>
                            </div>
                            <div class="nr" style="margin-right:16px">
                                <asp:Button ID="btnExportDetail" runat="server" Text="Xuất chi tiết đền bù" CssClass="button" OnClick="btnExportDetail_Click" />
                            </div>
                            <div class="cl"></div>
                        </div>
                        <div class="detail">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="table">
                                <tr>
                                    <th>Tên tài sản</th>
                                    <th>Số lượng</th>
                                    <th width="100px">Đơn giá (đồng)</th>
                                    <th width="100px">Thành tiền (đồng)</th>
                                </tr>                        
                            <asp:Repeater ID="rptLand" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("LandName") %></td>
                                        <td><%#Eval("Areas") %></td>
                                        <td><%#Eval("UnitPrice", "{0:N2}")%>&nbsp;/&nbsp;<%#Eval("Unit") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmounts","{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptHouse" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("Type")%></td>
                                        <td><%#Eval("Quantity") %></td>
                                        <td><%#Eval("UnitPrice", "{0:N2}")%>&nbsp;/&nbsp;<%#Eval("Unit") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>                            
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptBuilding" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("BuildingName") %></td>
                                        <td><%#Eval("Quantity") %></td>
                                        <td><%#Eval("UnitPrice", "{0:N2}")%>&nbsp;/&nbsp;<%#Eval("Unit") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptTrees" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("TreeName") %></td>
                                        <td><%#Eval("Quantity") %></td>
                                        <td><%#Eval("UnitPrice", "{0:N2}")%>&nbsp;/&nbsp;<%#Eval("Unit") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptGraves" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("GraveName") %></td>
                                        <td><%#Eval("Quantity") %></td>
                                        <td><%#Eval("UnitPrice", "{0:N2}")%>&nbsp;/&nbsp;<%#Eval("Unit") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>                                    
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Literal ID="ltrTotalCompensate" runat="server" EnableViewState="false" />
                            </table>
                        </div>
                        <p>
                            Danh sách các hỗ trợ được hưởng</p>
                        <div class="detail">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="table">
                                <tr>
                                    <th>Loại hỗ trợ</th>
                                    <th width="100px">Thành tiền (đồng)</th>
                                </tr>
                            <asp:Repeater ID="rptSupportMove" runat="server">                                
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("SupportName") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>                                    
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptSupportRent" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("SupportName") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptSupportStabilize" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("SupportName") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptSupportJob" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td>Hỗ trợ việc làm và chuyển đổi nghề nghiệp</td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("toAmount", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Repeater ID="rptSupportOther" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td><%#Eval("SupportName") %></td>
                                        <td style="text-align:right; padding-right:41px;"><%#Eval("UnitPrice", "{0:N2}")%></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                                <asp:Literal ID="ltrTotalSupport" runat="server" EnableViewState="false" />                      
                            </table>
                        </div>
                    </fieldset>
                    <div class="box-title" style="text-align:center; padding-top:3px">
                        <asp:Button ID="btnReturn2" CssClass="button" runat="server" Text="Trở về" OnClick="btnReturn2_Click" />
                        &nbsp;
                        <asp:Button ID="btnEdit" CssClass="button" runat="server" Text=" Sửa " 
                            onclick="btnEdit_Click" />
                        &nbsp;
                        <asp:Button ID="btnDelete" CssClass="button" runat="server" Text=" Xóa " 
                            onclick="btnDelete_Click" OnClientClick="return confirm('Xác nhận hành động xóa?');"/>
                    </div>
                </asp:Panel>
                <!-- End pnl3-->
<%--            </ContentTemplate>
        </asp:UpdatePanel>--%>
        <!--End pnltable-->
    </div>
</asp:Content>
